package com.dns.customers.dao;


import com.dns.framework.data.IData;
import com.dns.framework.data.IDataset;
import com.dns.framework.page.Pagination;
import net.sf.json.JSONObject;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface CustomerDao {

  /**
   * 新增大客户
   * @param customers 大客户信息的json字符串
   * @return
   * @throws Exception
   */
  public String addCustomerAccount(String customers) throws Exception;

  /**
   * 修改大客户信息
   * @param request
   * @param customers
   * @return
   * @throws Exception
   */
  public  String modifyCustomerAccount(HttpServletRequest request,String customers) throws Exception;

  /**
   * 删除大客户信息
   * @param request
   * @param customerJson
   * @return
   * @throws Exception
   */
  public  String  deleteCustomerAccount(HttpServletRequest request,String customerJson) throws Exception;


  /**
   * 根据客户id查询客户是否存在
   * @param custId 客户id
   * @return true：存在 ，false：不存在
   */
  public boolean checkIsExistsByCustId(String custId);

  /**
   * 根据custid查询大客户
   * @param custId 大客户id
   * @return 存在:返回Map，不存在：返回null
   */
  public Map<String,Object> queryUserById(String custId);

  /**
   * 分页查询大客户列表
   * @param custName 客户名称
   * @param pagination 分页信息
   * @return
   * @throws Exception
   */
  public IDataset queryCustListByName(String custName, Pagination pagination) throws Exception;

  /**
   * 查询大客户信息（包含域名信息）
   * @param custId 客户
   * @return
   */
  public Map<String,Object> queryAccoundDomain(String custId) throws Exception;

  /**
   * 查询所有域名类型
   * @param param
   * @return
   * @throws Exception
   */
  public List<Map<String,Object>> getDnsResTypes(Map param) throws Exception;
  /**
   * 查询大客户
   * @param custId 客户
   * @return 客户集合
   * @throws Exception
   */
  public List<Map<String, Object>> queryCustomerAccount(String custId)throws Exception;

  /**
   * 根据客户id查询客户域名信息
   * @param custID 客户id
   * @return
   * @throws Exception
   */
  public List<Map<String, Object>> queryParentname(String custID)throws Exception;

  /**
   * 根据客户ID查询未完成任务信息
   * @param param
   * @return
   * @throws Exception
   */
  public List<Map<String,Object>> getOrderInfoByCustId(Map  param) throws Exception;

  /**
   * 根据客户ID和域名类型查询客户归属的域名信息
   * @param custId
   * @param domain_type
   * @return
   * @throws Exception
   */
  public List<Map<String, Object>> queryDomainnameByIDAndType(String custId, String domain_type) throws Exception;

  /**
   * 分页查询域名列表
   * @param custID
   * @param pagination
   * @return
   * @throws Exception
   */
  public IDataset queryRecordInfo(String custID,Pagination pagination)throws Exception;

  /**
   * 根据多个条件查询订单及其详细信息
   * @param param
   * @param pagination
   * @return
   * @throws Exception
   */
  public IDataset queryOrder(IData param , Pagination pagination)throws Exception;

  /**
   * 查看订单详情
   * @param orderId 订单id
   * @return
   * @throws Exception
   */
  public List<Map<String, Object>> queryOrderMore(String orderId)throws Exception;

  /**
   * 查询所有省份信息
   * @param param
   * @return
   * @throws Exception
   */
  public List<Map<String,Object>> getAllProvinces(Map param) throws Exception;
  /**
   * 分页查询根域名详情
   * @param custId 客户id
   * @return
   */
  public IDataset queryRootDomainPage(String  custId,Pagination pagination) throws Exception;
}



